#include <stdio.h>
#include <sys/types.h>		//	open 依赖头文件
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>         //  close 依赖头文件
#include <sys/mman.h>		//	mmap 依赖头文件
#include <stdlib.h>		    //	malloc 依赖头文件
#include <linux/fb.h>       //  struct fb_var_screeninfo 依赖头文件
#include <sys/ioctl.h>      //  ioctl 依赖头文件
#include "my_codeh/lcd.h"	
#include "my_codeh/block.h"	    
#include "my_codeh/event.h"  
#include <string.h>


/*
    lcd_init:   帧缓冲初始化,相关成员变量赋初值
    @l:         指向的空间保存帧缓冲初对应的信息
    retval:     成功返回 0
                失败返回 <0
*/      
extern int blocks[ROW][LINE];

extern  int gameover ;
extern  int game_started ;
extern  int score ;
extern  int restrat ;
extern  int SPEED ;
extern  int yy_flag ;
int lcd_init(LCD *l)
{
    //  1、打开帧缓冲设备文件
    l->lcd_fd = open(FB,O_RDWR);        //  读写打开 帧缓冲设备
    if(l->lcd_fd == -1)                        //  打开错误
    {
        perror("open fb0 error");       //  解析错误
        return -1;
    }

    //  2、获取屏幕信息
    struct fb_var_screeninfo info;      //  保存获取到的屏幕信息
    if(ioctl(l->lcd_fd,FBIOGET_VSCREENINFO,&info) == -1)
    {
        perror("ioctl error");          //  解析错误
        return -2; 
    }
    l->xres = info.xres;                //  显示屏宽度(横向像素点个数)
    l->yres = info.yres;                //  显示屏高度(纵向像素点个数)
    l->bits = info.bits_per_pixel;      //  单个像素点所占 bit 数


    //  3、映射
    l->plcd = mmap(NULL,                        //  由操作系统自行分配
                    l->xres*l->yres*l->bits/8,  //  待映射的内存长度
                    PROT_READ | PROT_WRITE,     //  映射权限
                    MAP_SHARED,                 //  共享映射
                    l->lcd_fd,                  //  待映射 文件/设备 文件描述符
                    0);                         //  从头开始映射
    if(l->plcd == MAP_FAILED)
    {
        perror("mmap error");       //  解析错误
        return -3; 
    }
    return 0;
}


/*
    lcd_uninit:     帧缓冲解初始化,扫尾工作
    @l:             指向的空间保存帧缓冲初对应的信息
*/      
void lcd_uninit(LCD *l)
{
    //  1、解映射
    munmap(l->plcd,l->xres*l->yres*l->bits/8);

    //  2、关闭帧缓冲设备文件
    close(l->lcd_fd);
}


/*
    display_point:  在坐标地址(x,y)显示一个颜色为 color 像素点
    @x:             像素点在坐标轴的 X 坐标
    @y:             像素点在坐标轴的 Y 坐标 
    @color:         待显示颜色
    @plcd:          指向了 Linux 帧缓冲,保存其首地址
*/
void display_point(int x,int y,unsigned int color,unsigned int *plcd)
{
    if(x >= 0 && x <= 799 && y >= 0 && y <= 479)	//	防憨批
    {
        *(plcd + 800*y + x) = color;   
    }
}

/*
    display_rectangle:  在坐标地址(x0,y0)显示一个颜色为 color 宽为 w,高为 h 的矩形
    @x0:                待显示矩形在坐标轴的 X 坐标起点
    @y0:                待显示矩形在坐标轴的 Y 坐标起点
    @w:                 待显示矩形 宽度
    @h:                 待显示矩形 高度
    @color:             待显示颜色
    @plcd:              指向了 Linux 帧缓冲,保存其首地址
*/
void display_rectangle(int x0,int y0,int w,int h,unsigned int color,unsigned int *plcd)
{
    for(int y = y0;y < y0+h;y++)		//	有多少行就执行多少次
    {
        for(int x = x0;x < x0+w;x++)   	//	一行有多少个像素点 
        {
            display_point(x,y,color,plcd);
        }
    } 
}


/*
    display_circle:     在坐标地址(x0,y0)为圆心显示一个颜色为 color 半径为r 的圆形
    @x0:                待显示圆形的圆心在坐标轴的 X 坐标
    @y0:                待显示圆形的圆心在坐标轴的 Y 坐标
    @r:                 待显示圆形的半径
    @color:             待显示颜色
    @plcd:              指向了 Linux 帧缓冲,保存其首地址
*/
void display_circle(int x0,int y0,int r,unsigned int color,unsigned int *plcd)
{
    for(int y = y0-r;y < y0+r;y++)			//	有多少行就执行多少次;缩减计算的数量
    {
        for(int x = x0-r;x < x0+r;x++)   	//	一行有多少个像素点 
        {
            if((x-x0)*(x-x0)+(y-y0)*(y-y0) <= r*r)	//	点到圆心的距离 <= r 显示
            {
                display_point(x,y,color,plcd);
            }
        }
    } 
}

void display_doublelink(unsigned int color,unsigned int *plcd)//BBFFFF //ok       //这是显示出两边边界的函数，封装使用，每次刷新出新的图像时，都需要先清空屏幕
{                                                                  //然后流动显示图像，并初始化新的一行，并加上这个边界
    for(int y = 0;y < 480;y++)			//	有多少行就执行多少次;缩减计算的数量
    {
        for(int x = 0;x < 100;x++)   	//	一行有多少个像素点 
        {
            
            display_point(x,y,color,plcd);
            
        }
        for(int x = 700;x < 800;x++)   	//	一行有多少个像素点 
        {
            
            display_point(x,y,color,plcd);
            
        }
    }
}

void display_block(int x,int y,unsigned int *plcd)//这就是根据初始化的数组信息，检测每个区块是否为1，为1就黑色，不为1就不做处理（默认就是白色）
{   

    if(x==0&& y==0)
    {
        display_rectangle(100,0,120,80,0x000000,plcd);
        display_rectangle(100,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==1)
    {
        display_rectangle(220,0,120,80,0x000000,plcd);
        display_rectangle(220,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==2)
    {
        display_rectangle(340,0,120,80,0x000000,plcd);
        display_rectangle(340,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==3)
    {
        display_rectangle(460,0,120,80,0x000000,plcd);
        display_rectangle(460,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==4)
    {
        display_rectangle(580,0,120,80,0x000000,plcd);
        display_rectangle(580,78,120,2,0xFFFFFF,plcd);
    }
//   
    if(x==1&& y==0)
    {
        display_rectangle(100,80,120,80,0x000000,plcd);
        display_rectangle(100,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==1)
    {
        display_rectangle(220,80,120,80,0x000000,plcd);
        display_rectangle(220,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==2)
    {
        display_rectangle(340,80,120,80,0x000000,plcd);
        display_rectangle(340,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==3)
    {
        display_rectangle(460,80,120,80,0x000000,plcd);
        display_rectangle(460,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==4)
    {
        display_rectangle(580,80,120,80,0x000000,plcd);
        display_rectangle(580,158,120,2,0xFFFFFF,plcd);
    }
//
    if(x==2&& y==0)
    {
        display_rectangle(100,160,120,80,0x000000,plcd);
        display_rectangle(100,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==1)
    {
        display_rectangle(220,160,120,80,0x000000,plcd);
        display_rectangle(220,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==2)
    {
        display_rectangle(340,160,120,80,0x000000,plcd);
        display_rectangle(340,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==3)
    {
        display_rectangle(460,160,120,80,0x000000,plcd);
        display_rectangle(460,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==4)
    {
        display_rectangle(580,160,120,80,0x000000,plcd);
        display_rectangle(580,238,120,2,0xFFFFFF,plcd);
    }
//
    if(x==3&& y==0)
    {
        display_rectangle(100,240,120,80,0x000000,plcd);
        display_rectangle(100,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==1)
    {
        display_rectangle(220,240,120,80,0x000000,plcd);
        display_rectangle(220,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==2)
    {
        display_rectangle(340,240,120,80,0x000000,plcd);
        display_rectangle(340,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==3)
    {
        display_rectangle(460,240,120,80,0x000000,plcd);
        display_rectangle(460,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==4)
    {
        display_rectangle(580,240,120,80,0x000000,plcd);
        display_rectangle(580,318,120,2,0xFFFFFF,plcd);
    }
//
    if(x==4&& y==0)
    {
        display_rectangle(100,320,120,80,0x000000,plcd);
        display_rectangle(100,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==1)
    {
        display_rectangle(220,320,120,80,0x000000,plcd);
        display_rectangle(220,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==2)
    {
        display_rectangle(340,320,120,80,0x000000,plcd);
        display_rectangle(340,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==3)
    {
        display_rectangle(460,320,120,80,0x000000,plcd);
        display_rectangle(460,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==4)
    {
        display_rectangle(580,320,120,80,0x000000,plcd);
        display_rectangle(580,398,120,2,0xFFFFFF,plcd);
    }
//
    if(x==5&& y==0)
    {
        display_rectangle(100,400,120,80,0x000000,plcd);
        display_rectangle(100,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==1)
    {
        display_rectangle(220,400,120,80,0x000000,plcd);
        display_rectangle(220,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==2)
    {
        display_rectangle(340,400,120,80,0x000000,plcd);
        display_rectangle(340,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==3)
    {
        display_rectangle(460,400,120,80,0x000000,plcd);
        display_rectangle(460,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==4)
    {
        display_rectangle(580,400,120,80,0x000000,plcd);
        display_rectangle(580,478,120,2,0xFFFFFF,plcd);
    }

}
void display_hit(int x,int y,unsigned int *plcd)//这里就是将被击中的黑块，先通过数组赋予成2 ，再将所有为2的区域变成灰色
{   

    if(x==0&& y==0)
    {
        display_rectangle(100,0,120,80,0x666666,plcd);
        display_rectangle(100,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==1)
    {
        display_rectangle(220,0,120,80,0x666666,plcd);
        display_rectangle(220,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==2)
    {
        display_rectangle(340,0,120,80,0x666666,plcd);
        display_rectangle(340,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==3)
    {
        display_rectangle(460,0,120,80,0x666666,plcd);
        display_rectangle(460,78,120,2,0xFFFFFF,plcd);
    }
    if(x==0&& y==4)
    {
        display_rectangle(580,0,120,80,0x666666,plcd);
        display_rectangle(580,78,120,2,0xFFFFFF,plcd);
    }
//   
    if(x==1&& y==0)
    {
        display_rectangle(100,80,120,80,0x666666,plcd);
        display_rectangle(100,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==1)
    {
        display_rectangle(220,80,120,80,0x666666,plcd);
        display_rectangle(220,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==2)
    {
        display_rectangle(340,80,120,80,0x666666,plcd);
        display_rectangle(340,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==3)
    {
        display_rectangle(460,80,120,80,0x666666,plcd);
        display_rectangle(460,158,120,2,0xFFFFFF,plcd);
    }
    if(x==1&& y==4)
    {
        display_rectangle(580,80,120,80,0x666666,plcd);
        display_rectangle(580,158,120,2,0xFFFFFF,plcd);
    }
//
    if(x==2&& y==0)
    {
        display_rectangle(100,160,120,80,0x666666,plcd);
        display_rectangle(100,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==1)
    {
        display_rectangle(220,160,120,80,0x666666,plcd);
        display_rectangle(220,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==2)
    {
        display_rectangle(340,160,120,80,0x666666,plcd);
        display_rectangle(340,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==3)
    {
        display_rectangle(460,160,120,80,0x666666,plcd);
        display_rectangle(460,238,120,2,0xFFFFFF,plcd);
    }
    if(x==2&& y==4)
    {
        display_rectangle(580,160,120,80,0x666666,plcd);
        display_rectangle(580,238,120,2,0xFFFFFF,plcd);
    }
//
    if(x==3&& y==0)
    {
        display_rectangle(100,240,120,80,0x666666,plcd);
        display_rectangle(100,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==1)
    {
        display_rectangle(220,240,120,80,0x666666,plcd);
        display_rectangle(220,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==2)
    {
        display_rectangle(340,240,120,80,0x666666,plcd);
        display_rectangle(340,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==3)
    {
        display_rectangle(460,240,120,80,0x666666,plcd);
        display_rectangle(460,318,120,2,0xFFFFFF,plcd);
    }
    if(x==3&& y==4)
    {
        display_rectangle(580,240,120,80,0x666666,plcd);
        display_rectangle(580,318,120,2,0xFFFFFF,plcd);
    }
//
    if(x==4&& y==0)
    {
        display_rectangle(100,320,120,80,0x666666,plcd);
        display_rectangle(100,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==1)
    {
        display_rectangle(220,320,120,80,0x666666,plcd);
        display_rectangle(220,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==2)
    {
        display_rectangle(340,320,120,80,0x666666,plcd);
        display_rectangle(340,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==3)
    {
        display_rectangle(460,320,120,80,0x666666,plcd);
        display_rectangle(460,398,120,2,0xFFFFFF,plcd);
    }
    if(x==4&& y==4)
    {
        display_rectangle(580,320,120,80,0x666666,plcd);
        display_rectangle(580,398,120,2,0xFFFFFF,plcd);
    }
//
    if(x==5&& y==0)
    {
        display_rectangle(100,400,120,80,0x666666,plcd);
        display_rectangle(100,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==1)
    {
        display_rectangle(220,400,120,80,0x666666,plcd);
        display_rectangle(220,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==2)
    {
        display_rectangle(340,400,120,80,0x666666,plcd);
        display_rectangle(340,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==3)
    {
        display_rectangle(460,400,120,80,0x666666,plcd);
        display_rectangle(460,478,120,2,0xFFFFFF,plcd);
    }
    if(x==5&& y==4)
    {
        display_rectangle(580,400,120,80,0x666666,plcd);
        display_rectangle(580,478,120,2,0xFFFFFF,plcd);
    }

}

void display_all(unsigned int *plcd)//0x000000   0xFFFFFF
{
    for(int i= 0;i<ROW;i++)  //封装好后，当每次进行一次触摸信息收集后，都要判断，如果游戏没有结束，就需要把流动的界面进行更新，需要涂黑的变为黑色，需要涂灰为灰色
    {
        for(int j= 0 ; j<LINE;j++)
        {
            if(blocks[i][j]==1)
            {
                display_block(i,j,plcd);
            }
            if(blocks[i][j]==2)
            {
                display_hit(i,j,plcd);
            }
        }
    }
}

void display_init(unsigned int *plcd)//开始的初始化
{
    display_rectangle(0,0,800,480,0XFFFFFF,plcd);
    
    display_doublelink(0x8DEEEE,plcd);
}


// 绘制关闭图标：圆 + 叉号
void draw_close_icon(int x0, int y0, int r, unsigned int *plcd) //绘制的叉形图标，用于辨认
{
    // 1. 画基础圆形（调用你的画圆函数）
    display_circle(x0, y0, r, 0xDC143C, plcd);
    
    // 2. 画叉号：两条对角线
    // 斜线 1：左上 → 右下
    for (int i = -r/2; i <= r/2; i++) {
        int x = x0 + i;
        int y = y0 + i;
        if (x >= 0 && y >= 0) { // 边界保护（根据屏幕调整）
            display_point(x, y, 0xFFFFFFF, plcd);
        }
    }
    
    // 3. 斜线 2：右上 → 左下
    for (int i = -r/2; i <= r/2; i++) {
        int x = x0 + i;
        int y = y0 - i;
        if (x >= 0 && y >= 0) { // 边界保护（根据屏幕调整）
            display_point(x, y, 0xFFFFFFF, plcd);
        }
    }
}

// 绘制 “圆形 + 加号” 图标
// x0,y0: 圆心坐标; r: 圆形半径; colorCircle: 圆形颜色; colorPlus: 加号颜色; pLCD: LCD 显存指针
void draw_plus_icon(int x0, int y0, int r, unsigned int *plcd) //绘制的＋型图形，用于辨认
{
    // 1. 先画圆形外框
    display_circle(x0, y0, r, 0xFFFFFF, plcd);

    // 2. 画加号：两条垂直直线（水平、垂直中线）
    // 水平直线：覆盖圆形左右
    for (int x = x0 - r/2; x <= x0 + r/2; x++) 
    {
        int y = y0; // 水平中线
        if (x >= 0 && y >= 0) { // 边界保护（根据屏幕调整）
            display_point(x, y, 0x000000, plcd);
        }
    }
    // 垂直直线：覆盖圆形上下
    for (int y = y0 - r/2; y <= y0 + r/2; y++) {
        int x = x0; // 垂直中线
        if (x >= 0 && y >= 0) { // 边界保护（根据屏幕调整）
            display_point(x, y, 0x000000, plcd);
        }
    }
}

// 绘制 “圆形 + 减号” 图标
// x0,y0: 圆心坐标; r: 圆形半径; colorCircle: 圆形颜色; colorMinus: 减号颜色; pLCD: LCD 显存指针
void draw_minus_icon(int x0, int y0, int r, unsigned int *plcd) //绘制的🗡型图形
{
    // 1. 先画圆形外框
    display_circle(x0, y0, r, 0xFFFFFF, plcd);

    // 2. 画减号：一条水平直线（位于圆形中线）
    for (int x = x0 - r/2; x <= x0 + r/2; x++) 
    {
        int y = y0; // 水平中线
        if (x >= 0 && y >= 0) { // 边界保护（根据屏幕调整）
            display_point(x, y, 0x000000, plcd);
        }
    }
}

void display_char(int x0,int y0,int w,int h,char name[],int color,unsigned int*plcd) // 用来显示字的函数
{
    
	int x,y;//获取我们想要显示的点的坐标
	for(int i = 0; i < w*h/8;i++)//逐个字节 解析
	{
		for(int j = 7;j>=0;j--)//逐个分析bit，先从高位开始分析
		{
			if(name[i] & (1 << j))//判断当前bit显示数据
			{
				y = i/(w/8);//判断每一个 几个字节
				x = i%(w/8)*8 + (7 - j);
				//i%(w/8) 判断当前bit行该有多少个字节
				//i%(w/8)*8 判断有多少个像素点
                *(plcd + 800*(y+y0) + (x+x0)) = color;
			}
		}
	}
   
}

void lcd_show1()//显示文字“得分：”
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[400] = {
/*--  文字:  得  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xF6,0x00,0x60,
0x01,0xF7,0xFF,0xF0,0x03,0xC7,0x00,0xF0,0x03,0x87,0x00,0xE0,0x07,0x07,0x00,0xE0,
0x0E,0x77,0xFF,0xE0,0x1C,0x7F,0x00,0xE0,0x38,0xFF,0x00,0xE0,0x60,0xF7,0x00,0xE0,
0x01,0xE7,0xFF,0xE0,0x03,0xC7,0x00,0xE0,0x03,0x86,0x00,0xC0,0x07,0x80,0x00,0x38,
0x0F,0x9F,0xFF,0xFC,0x1F,0x8C,0x01,0xC0,0x3B,0x80,0x01,0xC0,0x73,0x80,0x01,0xDC,
0x03,0xFF,0xFF,0xFE,0x03,0xBE,0x01,0xC0,0x03,0x83,0x81,0xC0,0x03,0x81,0xC1,0xC0,
0x03,0x81,0xE1,0xC0,0x03,0x80,0xE1,0xC0,0x03,0x80,0xC1,0xC0,0x03,0x80,0x11,0xC0,
0x03,0x80,0x3F,0xC0,0x03,0x80,0x0F,0x80,0x03,0x80,0x03,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  分  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x78,0x00,0x00,0x1C,0x38,0x00,
0x00,0x3E,0x38,0x00,0x00,0x3C,0x38,0x00,0x00,0x78,0x18,0x00,0x00,0x78,0x1C,0x00,
0x00,0xF0,0x1C,0x00,0x00,0xE0,0x0E,0x00,0x01,0xE0,0x07,0x00,0x03,0xC0,0x07,0x80,
0x03,0x80,0x03,0xC0,0x07,0x00,0x07,0xF0,0x0F,0xFF,0xFF,0xFE,0x1C,0x8F,0x07,0x7E,
0x38,0x0E,0x07,0x38,0x60,0x0E,0x0F,0x00,0x00,0x0E,0x0F,0x00,0x00,0x1E,0x0F,0x00,
0x00,0x1C,0x0F,0x00,0x00,0x1C,0x0F,0x00,0x00,0x3C,0x0F,0x00,0x00,0x38,0x0E,0x00,
0x00,0x78,0x0E,0x00,0x00,0x70,0x0E,0x00,0x00,0xE0,0x0E,0x00,0x01,0xC3,0xFE,0x00,
0x07,0x81,0xFC,0x00,0x0E,0x00,0x78,0x00,0x38,0x00,0x30,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  ：  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,
0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,
0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

};
 for(int j=0;j<3;j++)//实现“得分：”字的显示，每个字占像素格子为40X35
    {
        x0 = j*32;//使汉字分开，每个字间隔40像素
        y0 = j*132;//每显示一个字使数组移动175个，使汉字依次显示
        display_char(300+x0,200,32,33,name+y0,0xFFFFFF,plcd);//从X轴300和200开始，Y轴始终为200，颜色为白色，内存映射改变值
    }
}

void lcd_show2(int score)
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
/*--  文字:  0  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x0F,0xF0,
0x1C,0x38,0x3C,0x3C,0x3C,0x1C,0x78,0x1C,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,
0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1C,0x38,0x3C,
0x3C,0x3C,0x1C,0x38,0x0F,0xF0,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  1  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0xC0,
0x1F,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,
0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,
0x03,0xC0,0x03,0xC0,0x03,0xE0,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  2  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x1E,0x78,
0x38,0x3C,0x38,0x1C,0x78,0x1C,0x78,0x1C,0x7C,0x1C,0x38,0x1C,0x00,0x3C,0x00,0x38,
0x00,0x70,0x00,0xF0,0x01,0xE0,0x03,0xC0,0x07,0x80,0x0F,0x00,0x0E,0x06,0x1C,0x0E,
0x38,0x0C,0x70,0x1C,0x7F,0xFC,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  3  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x1C,0xF0,
0x38,0x78,0x38,0x3C,0x38,0x3C,0x38,0x3C,0x00,0x3C,0x00,0x38,0x00,0x78,0x01,0xF0,
0x07,0xE0,0x00,0xF8,0x00,0x38,0x00,0x1C,0x00,0x1E,0x00,0x1E,0x38,0x1E,0x78,0x1E,
0x78,0x1C,0x38,0x3C,0x3C,0xF8,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  4  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x70,
0x00,0xF0,0x01,0xF0,0x01,0xF0,0x03,0xF0,0x03,0x70,0x07,0x70,0x0E,0x70,0x0C,0x70,
0x1C,0x70,0x18,0x70,0x38,0x70,0x70,0x70,0x60,0x70,0xFF,0xFF,0x00,0x70,0x00,0x70,
0x00,0x70,0x00,0x70,0x00,0xF8,0x07,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  5  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,
0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x39,0xC0,0x3F,0xF0,0x3E,0x78,
0x38,0x3C,0x38,0x1C,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x38,0x1E,0x78,0x1E,0x78,0x1C,
0x78,0x1C,0x38,0x3C,0x1E,0x78,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  6  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x0F,0x38,
0x1E,0x3C,0x1C,0x3C,0x38,0x18,0x38,0x00,0x78,0x00,0x78,0x00,0x7F,0xF0,0x7F,0xF8,
0x7C,0x3C,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x38,0x1E,
0x3C,0x1C,0x1C,0x1C,0x1F,0x78,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  7  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x3F,0xFE,
0x38,0x1C,0x30,0x18,0x70,0x38,0x20,0x30,0x00,0x70,0x00,0x60,0x00,0xE0,0x00,0xE0,
0x01,0xC0,0x01,0xC0,0x03,0xC0,0x03,0x80,0x03,0x80,0x03,0x80,0x07,0x80,0x07,0x80,
0x07,0x80,0x07,0x80,0x07,0x80,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  8  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x1E,0x78,
0x38,0x1C,0x78,0x1C,0x70,0x1E,0x70,0x1E,0x78,0x1C,0x3C,0x1C,0x3E,0x38,0x1F,0xF0,
0x0F,0xE0,0x1D,0xF8,0x38,0xF8,0x78,0x3C,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x70,0x1E,
0x70,0x1C,0x38,0x1C,0x1E,0x78,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  9  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x1E,0xF0,
0x38,0x38,0x78,0x3C,0x78,0x1C,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x78,0x1E,
0x78,0x3E,0x78,0x7E,0x3F,0xFE,0x1F,0xDE,0x00,0x1E,0x00,0x1C,0x00,0x3C,0x18,0x38,
0x3C,0x38,0x3C,0x70,0x3D,0xE0,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

};


    char score_str[20];//首先是定义一个字符型数组
    snprintf(score_str, sizeof(score_str), "%d", score);//通过snprintf连接将%d类型的score转化成sizeof(score_str)大小的char类型数组score_str
    int len = strlen(score_str);//计算长度，用于循环
        //从而得到我们需要进行显示的score的 数字 
    // 显示每一位数字
    for(int i = 0; i < len; i++) //循环具体的长度次数
    {
        int digit = score_str[i] - '0';  // 获取当前数字(0-9) 得到的ascii码减去'0'的ascii值就是具体的数字
        
        // 每个数字的点阵数据占66字节(16x33点阵)
        char *digit_data = name + digit * 66;//定义新的需要显示的数组
        
        // 计算显示位置
        x0 = 396 + i * (16 + 5);  // 每个数字宽16像素，间距5像素，由于每次显示要根据上一位调整位置，所以是变动的
        y0 = 200;
        
        // 显示数字
        display_char(x0, y0, 16, 33, digit_data, 0xFFFFFF, plcd);
    }

}

void lcd_show3()//显示文字“目前速度为：”
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
 /*--  文字:  目  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0x80,
0x01,0xFF,0xFF,0xC0,0x01,0xC0,0x03,0xC0,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xFF,0xFF,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xFF,0xFF,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0xFF,0xFF,0x80,0x01,0xC0,0x03,0x80,
0x01,0xC0,0x03,0x80,0x01,0xC0,0x03,0x80,0x01,0x80,0x03,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  前  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x0E,0x00,0x00,0x70,0x0F,0x00,
0x00,0x38,0x1E,0x00,0x00,0x3C,0x1C,0x00,0x00,0x1C,0x38,0x18,0x00,0x1C,0x30,0x3C,
0x7F,0xFF,0xFF,0xFE,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x0E,0x06,0x00,0xF0,
0x0F,0xFF,0x38,0xE0,0x0F,0x0E,0x3C,0xE0,0x0F,0x0E,0x38,0xE0,0x0F,0x0E,0x38,0xE0,
0x0F,0x0E,0x38,0xE0,0x0F,0xFE,0x38,0xE0,0x0F,0x0E,0x38,0xE0,0x0F,0x0E,0x38,0xE0,
0x0F,0x0E,0x38,0xE0,0x0F,0xFE,0x38,0xE0,0x0F,0x0E,0x38,0xE0,0x0F,0x0E,0x38,0xE0,
0x0F,0x0E,0x38,0xE0,0x0F,0x0E,0x38,0xE0,0x0F,0x0E,0x30,0xE0,0x0F,0x0E,0x1D,0xE0,
0x0F,0x7E,0x1F,0xE0,0x0F,0x3E,0x07,0xC0,0x0E,0x1C,0x03,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  速  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x3C,0x00,
0x1C,0x00,0x38,0x00,0x0F,0x00,0x38,0x38,0x0F,0x7F,0xFF,0xFC,0x07,0x30,0x38,0x00,
0x07,0x00,0x38,0x00,0x00,0x0C,0x38,0xE0,0x00,0x0F,0xFF,0xF0,0x00,0x0E,0x38,0xE0,
0x03,0x8E,0x38,0xE0,0x7F,0xCE,0x38,0xE0,0x33,0x8E,0x38,0xE0,0x03,0x8F,0xFF,0xE0,
0x03,0x8E,0x78,0xE0,0x03,0x8C,0xF8,0xC0,0x03,0x81,0xFC,0x00,0x03,0x81,0xFF,0x80,
0x03,0x83,0xBB,0xE0,0x03,0x87,0x39,0xF0,0x03,0x9E,0x38,0x78,0x03,0xB8,0x38,0x38,
0x0F,0xF0,0x38,0x30,0x1F,0xC0,0x38,0x00,0x7C,0xF0,0x38,0x00,0x78,0x7E,0x00,0x1F,
0x30,0x1F,0xFF,0xFE,0x00,0x07,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  度  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xE0,0x10,0x0E,0x00,0xE0,0x38,0x0F,0xFF,0xFF,0xFC,0x0F,0x0E,0x06,0x00,
0x0F,0x0F,0x07,0x80,0x0F,0x0E,0x07,0x30,0x0F,0x0E,0x07,0x78,0x0F,0xFF,0xFF,0xFC,
0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0E,0x0E,0x07,0x00,
0x0E,0x0F,0xFF,0x00,0x0E,0x0E,0x07,0x00,0x0E,0x0C,0x01,0x80,0x0E,0x7F,0xFF,0xC0,
0x0E,0x2E,0x07,0xC0,0x0E,0x06,0x07,0x00,0x1C,0x03,0x0F,0x00,0x1C,0x03,0x9E,0x00,
0x1C,0x01,0xFC,0x00,0x18,0x00,0xF8,0x00,0x38,0x01,0xFC,0x00,0x30,0x07,0xFF,0x80,
0x30,0x1F,0x0F,0xFE,0x60,0xF8,0x03,0xFC,0x67,0xC0,0x00,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  为  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xE0,0x00,
0x07,0x03,0xC0,0x00,0x03,0xC3,0xC0,0x00,0x01,0xE3,0xC0,0x00,0x00,0xF3,0xC0,0x00,
0x00,0xF3,0xC0,0x00,0x00,0x63,0x80,0x08,0x00,0x03,0x80,0x1C,0x3F,0xFF,0xFF,0xFE,
0x18,0x03,0x80,0x1C,0x00,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,0x07,0x00,0x3C,
0x00,0x0F,0xE0,0x3C,0x00,0x0F,0x78,0x3C,0x00,0x0E,0x3E,0x3C,0x00,0x1E,0x1F,0x38,
0x00,0x1C,0x0F,0x38,0x00,0x3C,0x07,0x38,0x00,0x78,0x03,0x38,0x00,0xF0,0x00,0x78,
0x00,0xE0,0x00,0x78,0x01,0xC0,0x00,0x78,0x03,0x80,0x00,0x78,0x07,0x00,0x7F,0xF0,
0x0E,0x00,0x1F,0xF0,0x3C,0x00,0x07,0xE0,0x70,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  ：  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,
0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,0x1F,0x80,0x00,0x00,
0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

};
 for(int j=0;j<6;j++)//实现“返回”字的显示，每个字占像素格子为40X35
    {
        x0 = j*32;//使汉字分开，每个字间隔40像素
        y0 = j*132;//每显示一个字使数组移动175个，使汉字依次显示
        display_char(300+x0,300,32,33,name+y0,0xFFFFFF,plcd);//从X轴0和40开始，Y轴始终为0，颜色为白色，内存映射改变值
    }
}

void lcd_show4(int speed)
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
/*--  文字:  0  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x0F,0xF0,
0x1C,0x38,0x3C,0x3C,0x3C,0x1C,0x78,0x1C,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,
0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1C,0x38,0x3C,
0x3C,0x3C,0x1C,0x38,0x0F,0xF0,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  1  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0xC0,
0x1F,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,
0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,0x03,0xC0,
0x03,0xC0,0x03,0xC0,0x03,0xE0,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  2  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x1E,0x78,
0x38,0x3C,0x38,0x1C,0x78,0x1C,0x78,0x1C,0x7C,0x1C,0x38,0x1C,0x00,0x3C,0x00,0x38,
0x00,0x70,0x00,0xF0,0x01,0xE0,0x03,0xC0,0x07,0x80,0x0F,0x00,0x0E,0x06,0x1C,0x0E,
0x38,0x0C,0x70,0x1C,0x7F,0xFC,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  3  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x1C,0xF0,
0x38,0x78,0x38,0x3C,0x38,0x3C,0x38,0x3C,0x00,0x3C,0x00,0x38,0x00,0x78,0x01,0xF0,
0x07,0xE0,0x00,0xF8,0x00,0x38,0x00,0x1C,0x00,0x1E,0x00,0x1E,0x38,0x1E,0x78,0x1E,
0x78,0x1C,0x38,0x3C,0x3C,0xF8,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  4  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x70,
0x00,0xF0,0x01,0xF0,0x01,0xF0,0x03,0xF0,0x03,0x70,0x07,0x70,0x0E,0x70,0x0C,0x70,
0x1C,0x70,0x18,0x70,0x38,0x70,0x70,0x70,0x60,0x70,0xFF,0xFF,0x00,0x70,0x00,0x70,
0x00,0x70,0x00,0x70,0x00,0xF8,0x07,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  5  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,
0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x39,0xC0,0x3F,0xF0,0x3E,0x78,
0x38,0x3C,0x38,0x1C,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x38,0x1E,0x78,0x1E,0x78,0x1C,
0x78,0x1C,0x38,0x3C,0x1E,0x78,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  6  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x0F,0x38,
0x1E,0x3C,0x1C,0x3C,0x38,0x18,0x38,0x00,0x78,0x00,0x78,0x00,0x7F,0xF0,0x7F,0xF8,
0x7C,0x3C,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x78,0x1E,0x38,0x1E,
0x3C,0x1C,0x1C,0x1C,0x1F,0x78,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  7  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x3F,0xFE,
0x38,0x1C,0x30,0x18,0x70,0x38,0x20,0x30,0x00,0x70,0x00,0x60,0x00,0xE0,0x00,0xE0,
0x01,0xC0,0x01,0xC0,0x03,0xC0,0x03,0x80,0x03,0x80,0x03,0x80,0x07,0x80,0x07,0x80,
0x07,0x80,0x07,0x80,0x07,0x80,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  8  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x1E,0x78,
0x38,0x1C,0x78,0x1C,0x70,0x1E,0x70,0x1E,0x78,0x1C,0x3C,0x1C,0x3E,0x38,0x1F,0xF0,
0x0F,0xE0,0x1D,0xF8,0x38,0xF8,0x78,0x3C,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x70,0x1E,
0x70,0x1C,0x38,0x1C,0x1E,0x78,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

/*--  文字:  9  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=16x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x1E,0xF0,
0x38,0x38,0x78,0x3C,0x78,0x1C,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x70,0x1E,0x78,0x1E,
0x78,0x3E,0x78,0x7E,0x3F,0xFE,0x1F,0xDE,0x00,0x1E,0x00,0x1C,0x00,0x3C,0x18,0x38,
0x3C,0x38,0x3C,0x70,0x3D,0xE0,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,

};


    char score_str[30];
    snprintf(score_str, sizeof(score_str), "%d", speed);
    int len = strlen(score_str);

    // 显示每一位数字
    for(int i = 0; i < len; i++) 
    {
        int digit = score_str[i] - '0';  // 获取当前数字(0-9)
        
        // 每个数字的点阵数据占66字节(16x33点阵)
        char *digit_data = name + digit * 66;
        
        // 计算显示位置
        x0 = 492 + i * (16 + 5);  // 每个数字宽16像素，间距5像素
        y0 = 300;
        
        // 显示数字
        display_char(x0, y0, 16, 33, digit_data, 0xFFFFFF, plcd);
    }
}

void lcd_show5()//显示文字“困难难度”
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
/*--  文字:  困  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x70,0x1F,0xFF,0xFF,0xF8,
0x1E,0x03,0xC0,0x78,0x1E,0x03,0xE0,0x78,0x1E,0x03,0xC0,0x78,0x1E,0x03,0xC0,0x78,
0x1E,0x03,0xC3,0x78,0x1E,0x03,0xC7,0x78,0x1F,0xFF,0xFF,0xF8,0x1F,0xC7,0xC0,0x78,
0x1E,0x07,0xC0,0x78,0x1E,0x0F,0xC0,0x78,0x1E,0x0F,0xE0,0x78,0x1E,0x1F,0xF8,0x78,
0x1E,0x1F,0xFE,0x78,0x1E,0x3B,0xDF,0x78,0x1E,0x73,0xCF,0xF8,0x1E,0x63,0xC7,0xF8,
0x1E,0xE3,0xC3,0xF8,0x1F,0xC3,0xC3,0x78,0x1F,0x03,0xC0,0x78,0x1E,0x03,0xC0,0x78,
0x1E,0x03,0xC0,0x78,0x1E,0x03,0xC0,0x78,0x1E,0x00,0x00,0x78,0x1E,0x00,0x00,0x78,
0x1F,0xFF,0xFF,0xF8,0x1E,0x00,0x00,0x78,0x1C,0x00,0x00,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  难  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0xFF,0x00,
0x00,0x00,0xF7,0x80,0x00,0x00,0xE7,0x80,0x00,0x18,0xE3,0x90,0x3F,0xFF,0xE3,0x38,
0x18,0x3D,0xFF,0xFC,0x00,0x39,0xC7,0x00,0x00,0x3B,0xC7,0x00,0x18,0x3B,0xC7,0x00,
0x1C,0x7B,0xC7,0x30,0x0E,0x77,0xC7,0x38,0x06,0x77,0xFF,0xFC,0x07,0xFF,0xC7,0x00,
0x03,0xFD,0xC7,0x00,0x01,0xF9,0xC7,0x00,0x01,0xE1,0xC7,0x00,0x01,0xF1,0xC7,0x10,
0x03,0xF1,0xC7,0x38,0x07,0xF9,0xFF,0xFC,0x07,0x39,0xC7,0x00,0x0E,0x3D,0xC7,0x00,
0x1C,0x3D,0xC7,0x00,0x18,0x19,0xC7,0x00,0x30,0x01,0xC7,0x1C,0x60,0x01,0xFF,0xFE,
0x40,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  难  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0xFF,0x00,
0x00,0x00,0xF7,0x80,0x00,0x00,0xE7,0x80,0x00,0x18,0xE3,0x90,0x3F,0xFF,0xE3,0x38,
0x18,0x3D,0xFF,0xFC,0x00,0x39,0xC7,0x00,0x00,0x3B,0xC7,0x00,0x18,0x3B,0xC7,0x00,
0x1C,0x7B,0xC7,0x30,0x0E,0x77,0xC7,0x38,0x06,0x77,0xFF,0xFC,0x07,0xFF,0xC7,0x00,
0x03,0xFD,0xC7,0x00,0x01,0xF9,0xC7,0x00,0x01,0xE1,0xC7,0x00,0x01,0xF1,0xC7,0x10,
0x03,0xF1,0xC7,0x38,0x07,0xF9,0xFF,0xFC,0x07,0x39,0xC7,0x00,0x0E,0x3D,0xC7,0x00,
0x1C,0x3D,0xC7,0x00,0x18,0x19,0xC7,0x00,0x30,0x01,0xC7,0x1C,0x60,0x01,0xFF,0xFE,
0x40,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  度  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xE0,0x10,0x0E,0x00,0xE0,0x38,0x0F,0xFF,0xFF,0xFC,0x0F,0x0E,0x06,0x00,
0x0F,0x0F,0x07,0x80,0x0F,0x0E,0x07,0x30,0x0F,0x0E,0x07,0x78,0x0F,0xFF,0xFF,0xFC,
0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0E,0x0E,0x07,0x00,
0x0E,0x0F,0xFF,0x00,0x0E,0x0E,0x07,0x00,0x0E,0x0C,0x01,0x80,0x0E,0x7F,0xFF,0xC0,
0x0E,0x2E,0x07,0xC0,0x0E,0x06,0x07,0x00,0x1C,0x03,0x0F,0x00,0x1C,0x03,0x9E,0x00,
0x1C,0x01,0xFC,0x00,0x18,0x00,0xF8,0x00,0x38,0x01,0xFC,0x00,0x30,0x07,0xFF,0x80,
0x30,0x1F,0x0F,0xFE,0x60,0xF8,0x03,0xFC,0x67,0xC0,0x00,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,


};
 for(int j=0;j<4;j++)//实现“得分：”字的显示，每个字占像素格子为40X35
    {
        x0 = j*32;//使汉字分开，每个字间隔40像素
        y0 = j*132;//每显示一个字使数组移动175个，使汉字依次显示
        display_char(300+x0,300,32,33,name+y0,0xFFFFFF,plcd);//从X轴300和200开始，Y轴始终为200，颜色为白色，内存映射改变值
    }
}

void lcd_show6()//显示文字“简单难度”
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
/*--  文字:  简  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x38,0x00,0x03,0xC0,0x3C,0x00,
0x07,0x87,0x78,0x38,0x07,0xFF,0xFF,0xFC,0x0E,0x70,0xE6,0x00,0x1C,0x79,0xC7,0x80,
0x18,0x3B,0x83,0x80,0x33,0xB3,0x03,0x00,0x61,0xE0,0x00,0x70,0x0C,0xEF,0xFF,0xF8,
0x0F,0xF6,0x00,0x70,0x0F,0x60,0x00,0x70,0x0E,0x18,0x38,0x70,0x0E,0x1F,0xFC,0x70,
0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x38,0x70,
0x0E,0x1F,0xF8,0x70,0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x38,0x70,
0x0E,0x1F,0xF8,0x70,0x0E,0x1C,0x38,0x70,0x0E,0x1C,0x00,0x70,0x0E,0x00,0x0F,0xF0,
0x0E,0x00,0x0F,0xF0,0x0E,0x00,0x01,0xE0,0x0E,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  单  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x0C,0x00,0x00,0x70,0x1F,0x00,
0x00,0x3C,0x1E,0x00,0x00,0x1C,0x3C,0x00,0x00,0x1C,0x38,0x00,0x07,0x0C,0x71,0xC0,
0x07,0xFF,0xFF,0xE0,0x07,0x83,0x81,0xC0,0x07,0x83,0x81,0xC0,0x07,0x83,0x81,0xC0,
0x07,0x83,0x81,0xC0,0x07,0xFF,0xFF,0xC0,0x07,0x83,0x81,0xC0,0x07,0x83,0x81,0xC0,
0x07,0x83,0x81,0xC0,0x07,0x83,0x81,0xC0,0x07,0xFF,0xFF,0xC0,0x07,0x83,0x81,0xC0,
0x07,0x83,0x81,0x98,0x00,0x03,0x80,0x3C,0x7F,0xFF,0xFF,0xFE,0x30,0x03,0x80,0x00,
0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,
0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  难  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0xFF,0x00,
0x00,0x00,0xF7,0x80,0x00,0x00,0xE7,0x80,0x00,0x18,0xE3,0x90,0x3F,0xFF,0xE3,0x38,
0x18,0x3D,0xFF,0xFC,0x00,0x39,0xC7,0x00,0x00,0x3B,0xC7,0x00,0x18,0x3B,0xC7,0x00,
0x1C,0x7B,0xC7,0x30,0x0E,0x77,0xC7,0x38,0x06,0x77,0xFF,0xFC,0x07,0xFF,0xC7,0x00,
0x03,0xFD,0xC7,0x00,0x01,0xF9,0xC7,0x00,0x01,0xE1,0xC7,0x00,0x01,0xF1,0xC7,0x10,
0x03,0xF1,0xC7,0x38,0x07,0xF9,0xFF,0xFC,0x07,0x39,0xC7,0x00,0x0E,0x3D,0xC7,0x00,
0x1C,0x3D,0xC7,0x00,0x18,0x19,0xC7,0x00,0x30,0x01,0xC7,0x1C,0x60,0x01,0xFF,0xFE,
0x40,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  度  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xE0,0x10,0x0E,0x00,0xE0,0x38,0x0F,0xFF,0xFF,0xFC,0x0F,0x0E,0x06,0x00,
0x0F,0x0F,0x07,0x80,0x0F,0x0E,0x07,0x30,0x0F,0x0E,0x07,0x78,0x0F,0xFF,0xFF,0xFC,
0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0E,0x0E,0x07,0x00,
0x0E,0x0F,0xFF,0x00,0x0E,0x0E,0x07,0x00,0x0E,0x0C,0x01,0x80,0x0E,0x7F,0xFF,0xC0,
0x0E,0x2E,0x07,0xC0,0x0E,0x06,0x07,0x00,0x1C,0x03,0x0F,0x00,0x1C,0x03,0x9E,0x00,
0x1C,0x01,0xFC,0x00,0x18,0x00,0xF8,0x00,0x38,0x01,0xFC,0x00,0x30,0x07,0xFF,0x80,
0x30,0x1F,0x0F,0xFE,0x60,0xF8,0x03,0xFC,0x67,0xC0,0x00,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

};
 for(int j=0;j<4;j++)//实现“得分：”字的显示，每个字占像素格子为40X35
    {
        x0 = j*32;//使汉字分开，每个字间隔40像素
        y0 = j*132;//每显示一个字使数组移动175个，使汉字依次显示
        display_char(300+x0,300,32,33,name+y0,0xFFFFFF,plcd);//从X轴300和200开始，Y轴始终为200，颜色为白色，内存映射改变值
    }
}

void lcd_show7()//显示文字“普通难度”
{
    int x0,y0,x1,y1,x2,y2;
    int fd;
    unsigned int* plcd = NULL;
    fd=open("/dev/fb0",O_RDWR);
    plcd = (unsigned int*)mmap(NULL,480*800*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
    unsigned char name[7000] = {
/*--  文字:  普  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0C,0x00,0x00,0x3C,0x1F,0x00,
0x00,0x1E,0x1C,0x00,0x00,0x1E,0x38,0x30,0x00,0x0E,0x30,0x78,0x1F,0xFF,0xFF,0xFC,
0x0C,0x1E,0x78,0x00,0x03,0x1E,0x79,0xE0,0x03,0x9E,0x79,0xE0,0x01,0xDE,0x7B,0xC0,
0x01,0xFE,0x7B,0x80,0x00,0xFE,0x7F,0x18,0x00,0xDE,0x7E,0x3C,0x7F,0xFF,0xFF,0xFE,
0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x03,0x80,0x01,0xFF,0xFF,0xC0,
0x01,0xE0,0x07,0x80,0x01,0xE0,0x07,0x80,0x01,0xE0,0x07,0x80,0x01,0xFF,0xFF,0x80,
0x01,0xE0,0x07,0x80,0x01,0xE0,0x07,0x80,0x01,0xE0,0x07,0x80,0x01,0xE0,0x07,0x80,
0x01,0xFF,0xFF,0x80,0x01,0xE0,0x07,0x80,0x01,0xC0,0x07,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  通  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1C,0x1F,0xFF,0xF0,
0x0E,0x0C,0x01,0xF0,0x0F,0x01,0xC7,0x80,0x07,0x00,0xFE,0x00,0x07,0x00,0x7C,0x00,
0x07,0x18,0x3C,0x30,0x00,0x1F,0xFF,0xF8,0x00,0x1C,0x38,0x78,0x00,0x1C,0x38,0x78,
0x03,0x1C,0x38,0x78,0x7F,0x9F,0xFF,0xF8,0x37,0x9C,0x38,0x78,0x07,0x9C,0x38,0x78,
0x07,0x9C,0x38,0x78,0x07,0x9C,0x38,0x78,0x07,0x9F,0xFF,0xF8,0x07,0x9C,0x38,0x78,
0x07,0x9C,0x38,0x78,0x07,0x9C,0x38,0x78,0x07,0x9C,0x38,0x78,0x07,0x9C,0x3B,0xF8,
0x07,0x9C,0x3B,0xF0,0x1F,0xD8,0x30,0xF0,0x3C,0xF0,0x00,0x60,0x78,0x7F,0xFF,0xFF,
0x70,0x1F,0xFF,0xFC,0x00,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  难  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0xFF,0x00,
0x00,0x00,0xF7,0x80,0x00,0x00,0xE7,0x80,0x00,0x18,0xE3,0x90,0x3F,0xFF,0xE3,0x38,
0x18,0x3D,0xFF,0xFC,0x00,0x39,0xC7,0x00,0x00,0x3B,0xC7,0x00,0x18,0x3B,0xC7,0x00,
0x1C,0x7B,0xC7,0x30,0x0E,0x77,0xC7,0x38,0x06,0x77,0xFF,0xFC,0x07,0xFF,0xC7,0x00,
0x03,0xFD,0xC7,0x00,0x01,0xF9,0xC7,0x00,0x01,0xE1,0xC7,0x00,0x01,0xF1,0xC7,0x10,
0x03,0xF1,0xC7,0x38,0x07,0xF9,0xFF,0xFC,0x07,0x39,0xC7,0x00,0x0E,0x3D,0xC7,0x00,
0x1C,0x3D,0xC7,0x00,0x18,0x19,0xC7,0x00,0x30,0x01,0xC7,0x1C,0x60,0x01,0xFF,0xFE,
0x40,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,

/*--  文字:  度  --*/
/*--  宋体24;  此字体下对应的点阵为：宽x高=32x33   --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xE0,0x10,0x0E,0x00,0xE0,0x38,0x0F,0xFF,0xFF,0xFC,0x0F,0x0E,0x06,0x00,
0x0F,0x0F,0x07,0x80,0x0F,0x0E,0x07,0x30,0x0F,0x0E,0x07,0x78,0x0F,0xFF,0xFF,0xFC,
0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0F,0x0E,0x07,0x00,0x0E,0x0E,0x07,0x00,
0x0E,0x0F,0xFF,0x00,0x0E,0x0E,0x07,0x00,0x0E,0x0C,0x01,0x80,0x0E,0x7F,0xFF,0xC0,
0x0E,0x2E,0x07,0xC0,0x0E,0x06,0x07,0x00,0x1C,0x03,0x0F,0x00,0x1C,0x03,0x9E,0x00,
0x1C,0x01,0xFC,0x00,0x18,0x00,0xF8,0x00,0x38,0x01,0xFC,0x00,0x30,0x07,0xFF,0x80,
0x30,0x1F,0x0F,0xFE,0x60,0xF8,0x03,0xFC,0x67,0xC0,0x00,0x78,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,


};
 for(int j=0;j<4;j++)//实现“得分：”字的显示，每个字占像素格子为40X35
    {
        x0 = j*32;//使汉字分开，每个字间隔40像素
        y0 = j*132;//每显示一个字使数组移动175个，使汉字依次显示
        display_char(300+x0,300,32,33,name+y0,0xFFFFFF,plcd);//从X轴300和200开始，Y轴始终为200，颜色为白色，内存映射改变值
    }
}





